import { useRoutes, Navigate } from 'react-router-dom'
import Home from '../views/router-view/Home'
import Category from '../views/router-view/Category'
import Car from '../views/router-view/Car'
import Car1 from '../views/router-view/Car1'
import Car2 from '../views/router-view/Car2'
import Detail from '../views/router-view/Detail'

const ele = [
    {
        path: '/home',
        element: <Home></Home>
    },
    {
        path: '/category',
        element: <Category></Category >
    },
    {
        path: '/car',
        element: <Car></Car>,
        children: [
            {
                path: '',
                element: <Car1></Car1 >
            },
            {
                path: '/car/car1',
                element: <Car1></Car1 >
            },
            {
                path: '/car/car2',
                element: <Car2></Car2 >
            },
        ]
    },
    {
        path: '/detail/:id?',
        element: <Detail></Detail>
    },
    {
        path: '/',
        element: <Navigate to='/home'></Navigate>
    }
]




export default ele